
package com.x52im.rbchat.logic.chat_friend.gift.model;

/**
 * 我的礼品包中的礼品数据封装类.
 * <p>
 * 本类实际上是{@link Gift}加上礼品数据组成的新类，意义是：XX礼品有XX数量。
 * 
 * @author Jack Jiang(http://www.52im.net/space-uid-1.html)
 * @since 2.5
 * @see Gift
 */
public class GiftInPackage extends Gift
{
	// 该礼品的当前数据
	private int quantity = 0;
	
	public GiftInPackage()
	{
		super();
	}

	public int getQuantity()
	{
		return quantity;
	}

	public void setQuantity(int quantity)
	{
		this.quantity = quantity;
	}
	
	public static GiftInPackage cloneFromGift(Gift g)
	{
		GiftInPackage gip = new GiftInPackage();
		gip.setGift_ident(g.getGift_ident());
		gip.setGift_name(g.getGift_name());
		gip.setIs_valid(g.getIs_valid());
		gip.setPrice(String.valueOf(g.getPrice()));
		gip.setQuantity(0);
		gip.setRes_drawable_id(g.getRes_drawable_id());
		return gip;
	}
}
